import java.util.Arrays;

public class Test {
    public static void testDirectInsert(int[] nums){
        Sort.DirectInsert(nums);
        System.out.println(Arrays.toString(nums));
    }

    public static void testBinInsert(int[] nums){
        Sort.BinInsert(nums);
        System.out.println(Arrays.toString(nums));

    }
    public static void testShellSort(int[] nums){
        Sort.shellSort(nums);
        System.out.println(Arrays.toString(nums));

    }

    public static void testBubbleSort(int[] nums){
        Sort.bubbleSort(nums);
        System.out.println(Arrays.toString(nums));

    }


    public static void testQSort(int[] nums){
        Sort.qSort(nums);
        System.out.println(Arrays.toString(nums));

    }

    public static void testSelectSort(int[] nums){
        Sort.selectSort(nums);
        System.out.println(Arrays.toString(nums));

    }

    public static void testHeapSort(int[] nums){
        Sort.heapSort(nums);
        System.out.println(Arrays.toString(nums));

    }
    public static void testMergeSort(int[] nums){
        int[] temp = new int[nums.length];//归并排序需要额外的空间
        Sort.mergeSort(nums,0,nums.length,temp);
        System.out.println(Arrays.toString(nums));

    }
    public static void testRadixSort(int[] nums){
        Sort.radixSort(nums);
        System.out.println(Arrays.toString(nums));

    }
    public static void main(String[] args) {
        int[] nums = {3,1,6,9,4,22,11,8};
        System.out.println(Arrays.toString(nums));
        //testDirectInsert(nums);

        //testBinInsert(nums);
        testSelectSort(nums);
        //testShellSort(nums);
        //testBubbleSort(nums);
        //testQSort(nums);
        //testHeapSort(nums);
        //testRadixSort(nums);
    }
}
